package com.example.design.结构型设计模式.装饰器模式;

// 3. 创建一个装饰器抽象类
public abstract class CoffeeDecorator implements Coffee {
    // protected 作用域为当前包及子包可访问
    protected Coffee decoratedCoffee;

    public CoffeeDecorator(Coffee coffee) {
        this.decoratedCoffee = coffee;
    }

    @Override
    public String getDescription() {
        return decoratedCoffee.getDescription();
    }

    @Override
    public double cost() {
        return decoratedCoffee.cost();
    }
}
